#include <bits/stdc++.h>
using namespace std;
const int N = 110, M = 10010;
int n, m;
int a[N], f[M];
int main() {
  cin >> n >> m;
  f[0] = 1;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i) {
    for (int j = m; j >= a[i]; --j) {
      f[j] += f[j - a[i]];
    }
  }
  cout << f[m] << endl;
}
